Needed Narrowing in Prolog
نویسنده
چکیده
– [root property] The minimum element, referred to as the root, of T is f(X1, . . . , Xn), where X1, . . . , Xn are distinct variables. – [leaves property] The maximal elements, referred to as the leaves, of T are all and only (variants of) the left hand sides of the rules defining f . Non-maximal elements of T are referred to as branches. – [parent property] If π is a pattern of T different from the root, there exists in T a unique pattern π′ strictly preceding π such that there exists no other pattern strictly between π and π′. π′ is referred to as the parent of π and π as a child of π′. – [induction property] All the children of a same parent differ from each other only at the position of a variable, referred to as inductive, of their parent.
منابع مشابه
Implementing Natural Rewriting and Narrowing Efficiently
Outermost-needed rewriting/narrowing is a sound and complete optimal demand-driven strategy for the class of inductively sequential constructor systems. Its parallel extension, known as weakly, deals with non-inductively sequential constructor systems. Recently, refinements of (weakly) outermost-needed rewriting and narrowing have been obtained. These new strategies are called natural rewriting...
متن کاملRefined Definitional Trees and Prolog Implementations of Narrowing
This paper describes how high level implementations of (needed) narrowing into Prolog can be improved by introducing a refined representation of definitional trees that handles properly the knowledge about the inductive positions of a pattern. We define some generic algorithms that allow us to transform a functional logic program into a set of Prolog clauses which incorporates some refinements ...
متن کاملImplementation of Narrowing : The Prolog - Based Approach
We present the problem of integrating functional languages and logic languages. We explain why the narrowing-based techniques have so far prevailed as operational mechanisms for the functional logic interpreters. We then discuss various strategies of narrowing. Finally we explain how to simulate these strategies of narrowing using the leftmost SLD-resolution rule of Prolog, and compare some exp...
متن کاملUser's Functions in Standard Prolog
We integrate user-defined functions with semantic equations into standard Prolog. In order to interface them with Prolog, we introduce a single operator. If a predicate invocation is prefixed by this operator, its parameters are expressions evaluated by the standard arithmetic of Prolog, and by our equations using innermost basic narrowing. The extended language is called PLN 5. (PLN = ProLog w...
متن کاملMulti-paradigm Logic Programming Sequential Implementation of Parallel Narrowing
Parallel Narrowing is a narrowing strategy which exploits expression parallelism. We present the rst implementation by transforming weakly orthogonal, constructor-based programs into Prolog with the help of parallel deenitional trees. We deene translation scheme for the general case of multistep narrowing, which is then extended to parallel narrowing by additional elimination rules. Our impleme...
متن کاملEfficient Compilation of Lazy Narrowing into Prolog
The paper presents new techniques for the transformation of lazy narrowing in logic programs. A formalism, called demand patterns, is introduced , and used to deene a demand driven strategy to compute lazy narrowing. The strategy is used to produce standard PROLOG code from programs written in a functional-logic language. Our method has a number of advantages over other approaches. While it can...
متن کامل